#include "Particle.h"

Particle::Particle()
{
	for(int i = 0; i< 3; i++)
	{
		transform[i] = 0;
		color[i] = 1;
		life = 0;
		speedX = 0;
		speedY = 0;
		speedZ = 0;
	}
}

void Particle::updateParticle(double transX, double transY, double transZ)
{
	transform[0] = transX;
	transform[1] = transY;
	transform[2] = transZ;
}

void Particle::setLifeSpeed(double LIFE, double SPEEDX, double SPEEDY, double SPEEDZ)
{
	life = LIFE;
	speedX = SPEEDX;
	speedY = SPEEDY;
	speedZ = SPEEDZ;
}

void Particle::updateParticleWithSpeed()
{
	life --;
	transform[0] += speedX;	
	transform[1] += speedY;
	transform[2] += speedZ;

	if(life <= 0)
	{
		transform[0] = 0;
		transform[1] = 0;
		transform[2] = 0;
	}
	
}